
<style type="text/css">
#content{/* width:960px; */ margin-top: 0px;}

#changePasswordDiv{width: 930px; margin:125px auto;}
#changePasswordDiv dl{margin:12.5px 0;}
#changePasswordDiv dt, #changePasswordDiv dd{display:inline-block;}
#changePasswordDiv dt{width:200px; text-align:right;}
#changePasswordDiv dt label{font-size: 37.5px;}
#changePasswordDiv dd{width:720px;}
#changePasswordDiv dd .input-text{width: 500px; height:60px; margin-top:25px; border: 2px solid #ccc;}
#changePasswordDiv dd .input-submit{width: 504px; height:64px; margin-top:25px; font-size: 37.5px;}
</style>

<div id="changePasswordDiv">
	<form id="changePasswordForm" action="<?php echo $view_data['do_change_password_url']; ?>" method="post" onsubmit="return do_change_password();">
    	<dl>
            <dt id="origin_password-label"><label for="origin_password">原密码：</label></dt>
            <dd id="origin_password-element">
                <input class="input-text" type="password" id="origin_password" name="origin_password" value="" />
            </dd>
        </dl>
            
        <dl>           
            <dt id="password-label"><label for="password">密码：</label></dt>
            <dd id="password-element">
                <input class="input-text" type="password" id="password" name="password" value="" />
            </dd>
        </dl>
            
        <dl>    
            <dt id="confirm_password-label"><label for="confirm_password">确认密码：</label></dt>
            <dd id="confirm_password-element">
                <input class="input-text" type="password" id="confirm_password" name="confirm_password" value="" />
            </dd>  
        </dl>
            
        <dl>    
            <dt id="submit-label">&nbsp;</dt>
            <dd id="submit-element">
                <input class="input-submit" type="submit" value="确定" />

                <div class="form_error_message">
                    <span class="form_error_message_mark">!</span>
                    <span class="form_error_message_content"></span>
                </div>
            </dd>
        </dl>  
    </form>
</div>

<script type="text/javascript">
function re_login(){
    window.location.replace('<?php echo $view_data['login_url']; ?>');
}


function do_change_password(){
	$.ajax({
		type: 'POST',
		url: '<?php echo $view_data['do_change_password_url']; ?>',
		data: $('#changePasswordForm').serialize(),
		dataType: 'json',
		success: function(rdata){
			if(rdata.status <= 0){
				//alert(rdata.message);
                show_form_error_message(rdata.message);
			}else{
//				alert(rdata.message);
//				window.location.replace('<?php //echo $view_data['login_url']; ?>//');

                show_prompt_message(rdata.message, re_login);
			}	
			
			return false;	
		}
	});
	
	return false;
}

</script>  